package com.example.yuanann.vegetable_app.repository.entity;

import androidx.annotation.NonNull;
import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.Index;
import androidx.room.PrimaryKey;

@Entity(tableName = "users",
indices = {@Index(value = "user_name", unique = true, name = "idx_unique_username")})
public class User {

    /**
     * 用户id
     */
    @NonNull
    @PrimaryKey(autoGenerate = true)
    @ColumnInfo(name = "user_id")
    private int userId;

    /**
     * 用户名称
     */
    @ColumnInfo(name = "user_name")
    private String userName;

    /**
     * 密码
     * 默认：123456
     */
    @ColumnInfo(name = "password")
    private String password;

    /**
     * normal/merchant
     */
    @ColumnInfo(name = "user_type")
    private String userType;

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getUserType() {
        return userType;
    }

    public void setUserType(String userType) {
        this.userType = userType;
    }
}
